﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class Manager_Quangcao_Controls_Themquangcao : System.Web.UI.UserControl
{
    BUS_Advertise Ad = new BUS_Advertise();
    protected void Page_Load(object sender, EventArgs e)
    {

    }


    protected void btnThem_Click(object sender, EventArgs e)
    {
        DTO_Advertise obj = new DTO_Advertise();
        obj.Name = txtName.Text;
        obj.Link = txtLink.Text;
        if (FileUpload1.HasFile)
        {
            FileUpload1.SaveAs(Server.MapPath("~/Upload/Advertise/" + FileUpload1.FileName));
            obj.Images = "~/Upload/Advertise/" + FileUpload1.FileName;
        }
        obj.Target = drlTarget.SelectedValue;
        obj.Position = int.Parse(drlPositon.SelectedValue);
        obj.Order = int.Parse(txtOrder.Text);
        obj.DateStar = txtDateStar.Text;
        obj.DateEnd = txtDateEnd.Text;

        Ad.Advertise_Insert(obj);
        
    }
}